//context上下文，创建全局数据
import { createContext } from "react";
import Home from "../page/Home";
import SwipeList from "../page/Swipe/SwipeList.tsx";
export const context = createContext<any>({});
export const routeData = [
  {
    path: "home",
    element: <Home />,
  },
  {
    path: "swipe",
    children: [
      {
        path: "/swipe/swipelist",
        element: <SwipeList />,
      },
    ],
  },
];

function AppProvider({ children }: any) {
  console.log(children);
  return <context.Provider value={{ routeData }}>{children}</context.Provider>;
}

export default AppProvider;
